//
// Created by xili on 2024/8/31 13:33.
// GO BIG OR GO HOME.
//
#include "leetcode.h"

class Solution {
public:
    string getSmallestString(int n, int k) {
        string ans = "";
        for (int i = 1; i <= n; i++) {
            int mn = max(1, k - (n - i) * 26);
            k -= mn;
            ans += ('a' + mn - 1);
        }
        return ans;
    }
};